
function login(){
    //window.event.returnValue=false
    window.location.href = "index-i.html";
}

function login1(){
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;

    var ajax = new $ax("login/in",function (data) {
       // 成功
        if(data.message == "true"){

            cookie.set("token",data.token,24);//设置为24天过期
            login();
            // window.event.returnValue=false
            // window.location.href = "index-i.html";

        }else {
            alert(data.message);
        }

    }, function (data) {
        // 失败
        alert("访问失败");
        errorAjax();
    });
    ajax.set('username',username);
    ajax.set('password',password);
    ajax.isSetToken(false);
    ajax.start();
	
}
